<?php

class Cat_Tags_Php_Assert_Type extends Cat_Processor_Monkey_TagBase
{
	function getOutput()
	{
		$args = $this->getArgs();
		
		$schema = array(
			0 => 'string',
			1 => 'string'
		);
		
		Cat_Common::checkArgs( $args, $schema );

		$value = '$' . $args[0];
		$types = var_export( explode(',', $args[1]), 1 );
		
		$code = "Cat_Assert::assertType($value, $types, '{$args[0]}');\n";
		
		return $code;
	}
}